package com.v.service.controller;

import com.v.dao.model.UserDO;
import com.v.service.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/user")
    public List<UserDO> getUser() {
        List<UserDO> result = userService.getResultList(null);
        return result;
    }

    @PostMapping("/operateuser")
    public  void operateUser(@RequestBody UserDO userDO){
        userService.updateUserDataService(userDO);
    }
}
